<?php
/**
 * Author   : 葫芦瓢子 <gourdladle@163.com>
 * Date     : 2023-07-03
 * Wechat   : skymouses
 * License  : MIT
 */

namespace GourdLadle\PhinxTp\migrate;

use GourdLadle\PhinxTp\Phinx;
use think\console\Input;
use think\console\Output;

class Run extends Phinx
{
    protected function configure()
    {
        $this->setName('phinx:migrate:run')
            ->setDescription('执行迁移')
            ->addEnvironmentOption()
            ->addTargetOption();
    }

    protected function execute(Input $input, Output $output)
    {
        $commandName = 'migrate';
        $arg = ['command'=>$commandName];
        $this->phinxEnvironmentOption($arg, $input);
        $this->phinxTargetOption($arg, $input);
        $this->runPhinx($commandName, $arg);
    }
    
}